package vn.edu.vttu;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainBT1 extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_bt1);
    }
public void timMin(View view){
	EditText num1 = (EditText) findViewById(R.id.so1);
	EditText num2 = (EditText) findViewById(R.id.so2);
	int num1Value = Integer.parseInt(num1.getText().toString());
	int num2Value = Integer.parseInt(num2.getText().toString());
	int sonho = (num1Value>num2Value) ? num2Value : num1Value;
	//messagebox
	Toast.makeText(this, "Số min là: "+sonho, 1000).show();
	TextView txt = (TextView)findViewById(R.id.ketqua);
	txt.setText("Số min là: "+sonho);
	}
}